package com.airS.task.fileMgr.utils.httpConvert;

import com.airS.task.fileMgr.common.response.StatusCode;
import com.alibaba.fastjson.serializer.ValueFilter;

/**
 * Created by alan on 2017/3/9.
 */
public class CustomSerializeFilter implements ValueFilter {
    public Object process(Object object, String name, Object value) {
        if (null == value) {
            return value;
        } else if (value instanceof StatusCode) {
            return ((StatusCode) value).code();
        } else if (value instanceof ValuedEnum) {
            return ((ValuedEnum) value).value();
        }
        return value;
    }
}
